<?php 
	$tlbItem = new Zendvn_Model_Table_ProductCategories();
	$arrItem = $tlbItem->listItemAll($this->arrParam, array('task' => 'main-category'));
	
	$cat_id	= '';
	if($this->arrParam['action'] == 'product-category'){
		$cat_id = $this->arrParam['id'];
	}
	
	if(!empty($arrItem)):
		$newMenu = '';
		$recursive = new Zendvn_Recursive();
		$recursive->recursiveUL($arrItem, 1, $newMenu);
		$newMenu = preg_replace('#<ul[^>]+>(\s+)?</ul>#imsU', '', $newMenu);
?>


  	<div id="nav-menu">
		<div class="menu">
			<?php echo $newMenu?>
		</div>
	</div>
<?php endif;?>    

<script>
	$(document).ready(function(){
			$('li').has('ul').mouseover(function(){
				$(this).children('ul').css('visibility','visible');
			}).mouseout(function(){
				$(this).children('ul').css('visibility','hidden');
			})

		
		var cat_id = '<?php echo $cat_id?>';
		$('li#liMenu_' + cat_id).addClass('active');
		/*$('li').hover(function(){
			$(this).find('ul:first').slideDown(200);
		},function(){
			$(this).find('ul:first').slideUp(150);
		})*/
	})
</script>           

